#include <STC15F2K60S2.H>

unsigned char Key_Read()
{
	unsigned char Key_Number=0;
	ET1=0;
	P44=0;P42=1;P35=1;P34=1;
	if(P33==0)Key_Number=4;
	if(P32==0)Key_Number=5;
	if(P31==0)Key_Number=6;
	if(P30==0)Key_Number=7;
	P44=1;P42=0;P35=1;P34=1;
	if(P33==0)Key_Number=8;
	if(P32==0)Key_Number=9;
	if(P31==0)Key_Number=10;
	if(P30==0)Key_Number=11;
	P44=1;P42=1;P35=0;P34=1;
	if(P33==0)Key_Number=12;
	if(P32==0)Key_Number=13;
	if(P31==0)Key_Number=14;
	if(P30==0)Key_Number=15;
	P44=1;P42=1;P35=1;P34=0;
	if(P33==0)Key_Number=16;
	if(P32==0)Key_Number=17;
	if(P31==0)Key_Number=18;
	if(P30==0)Key_Number=19;
	P3=0xff;
	ET1=1;
	return Key_Number;
}